package com.openbravo.data.loader;

import com.openbravo.basic.BasicException;

public class BasicSentenceEnum
  implements SentenceEnum
{
  BaseSentence sent;
  DataResultSet SRS;

  public BasicSentenceEnum(BaseSentence paramBaseSentence)
  {
    this.sent = paramBaseSentence;
    this.SRS = null;
  }

  public void load()
    throws BasicException
  {
    load(null);
  }

  public void load(Object paramObject)
    throws BasicException
  {
    this.SRS = this.sent.openExec(paramObject);
  }

  public Object getCurrent()
    throws BasicException
  {
    if (this.SRS == null)
      throw new BasicException(LocalRes.getIntString("exception.nodataset"));
    return this.SRS.getCurrent();
  }

  public boolean next()
    throws BasicException
  {
    if (this.SRS == null)
      throw new BasicException(LocalRes.getIntString("exception.nodataset"));
    if (this.SRS.next())
      return true;
    this.SRS.close();
    this.SRS = null;
    this.sent.closeExec();
    return false;
  }
}

/* Location:           D:\PowerFulPOS-2.30.2\openbravopos.jar
 * Qualified Name:     com.openbravo.data.loader.BasicSentenceEnum
 * JD-Core Version:    0.6.0
 */